package org.martin.snsrs.client.model;

import org.json.JSONException;
import org.json.JSONObject;

public class LoginResult extends Entity{
	
	String username;
	
	String nickname;
	
	Integer userID;
	
	String sessionKey;

	public LoginResult(JSONObject object) {
		super(object);
		onParse(object);
	}
	
	protected void onParse(JSONObject object){
		super.onParse(object);
		if(!isSuccess)
			return;
		try {
			username = object.getString("username");
			nickname = object.getString("nickname");
			userID = object.getInt("userID");
			sessionKey = object.getString("sessionKey");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public Integer getUserID() {
		return userID;
	}

	public void setUserID(Integer userID) {
		this.userID = userID;
	}

	public String getSessionKey() {
		return sessionKey;
	}

	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}

}
